﻿@using System.Linq
@using System.Collections.Generic
@using System.Globalization
@using Localization.Resources.AbpUi
@using Coso.Abp.Theme.AdminLTE.Bundling;
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Components
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Views.Error
@model AbpErrorViewModel
@inject IHtmlLocalizer<AbpUiResource> L
@inject IBrandingProvider BrandingProvider
@{
    Layout = null;
    var errorMessage = Model.ErrorInfo.Message;
    var errorDetails = Model.ErrorInfo.Details;
    if (errorDetails.IsNullOrEmpty())
    {
        errorDetails = errorMessage;
        errorMessage = L["Error"].Value + "!";
    }
}
<!DOCTYPE html>
<html lang="@CultureInfo.CurrentCulture.Name">
<head>
    <meta charset="UTF-8">
    <abp-style-bundle name="@AdminLTEThemeBundles.Styles.Global"/>
    <title>@Model.HttpStatusCode</title>
</head>
<body style="background:#fafdfb;">
    <section class="section">
        <div class="container mt-5">
            <div class="page-error">
                <div class="page-inner">
                    <h1>@Model.HttpStatusCode</h1>
                    <h2>@errorMessage</h2>
                    <div class="page-description">
                        @errorDetails
                        @if (!Model.ErrorInfo.ValidationErrors.IsNullOrEmpty())
                        {
                            foreach (var validationError in Model.ErrorInfo.ValidationErrors)
                            {
                                <text>* </text>@(validationError.Message)
                                if (validationError.Members != null && validationError.Members.Any())
                                {
                                    <text>(@string.Join(", ", validationError.Members))</text>
                                }
                                <br/>
                            }
                        }
                    </div>
                    <div class="page-search">
                        <div class="mt-3">
                            <a class="btn btn-primary btn-lg" href="/">Back to Home</a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="simple-footer mt-5">
                @BrandingProvider.AppName @DateTime.Now.Year
            </div>
        </div>
    </section>


<abp-script-bundle name="@AdminLTEThemeBundles.Scripts.Global"/>

</body>
</html>